<!DOCTYPE html>
<html>


<!-- Mirrored from www.zi-han.net/theme/hplus/table_jqgrid.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 20 Jan 2016 14:20:02 GMT -->
<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title></title>
    <link rel="shortcut icon" href="../../favicon.ico"> <link href="../../css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
    <link href="../../css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">

    <!--bootstraptable-->
    <link href="../../js/plugins/bootstrap_table/bootstrap-table.css" rel="stylesheet">

    <link href="../../css/animate.min.css" rel="stylesheet">
    <link href="../../css/style.min862f.css?v=4.1.0" rel="stylesheet">
    <link rel="stylesheet" href="../../js/plugins/layui/css/layui.css?v=2.1.2">
</head>

<body class="gray-bg">
<div class="wrapper wrapper-content  animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox ">
                <div class="ibox-content">
                    <table id="rooms" data-mobile-responsive="true"></table>
                </div>
            </div>
        </div>

    </div>
</div>

<script src="../../js/jquery.min.js?v=2.1.4"></script>
<script src="../../js/jquery.cookie.js?v=2.1.4"></script>
<script src="../../js/tools/jquery.ajax.js?v=2.1.4"></script>
<script src="../../js/tools/init.js?v=0.0.1"></script>
<script src="../../js/bootstrap.min.js?v=3.3.6"></script>
<script src="../../js/content.min.js?v=1.0.0"></script>
<script src="../../js/plugins/bootstrap_table/bootstrap-table.js"></script>
<script src="../../js/plugins/bootstrap_table/locale/bootstrap-table-zh-CN.min.js"></script>
<script src="../../js/plugins/datapicker/bootstrap-datepicker.js"></script>
<script src="../../js/plugins/layui/layui.js?v=2.1.2"></script>
<!--当前页面常量-->
<script src="js/constant.js"></script>
<script>
    /**
     * 获取拍卖会id，根据拍卖会id查询拍品列表
     */
   var id = tools.get_url_value("id");
   var _grid_data;
   function pop_imgs(index){
       layui.use('layer', function(){
           var layer = layui.layer;
           var row = _grid_data[index].product_photos_list;
           var img_data={
               "title": "", //相册标题
               "id": index, //相册id
               "start": 0, //初始显示的图片序号，默认0
               "data": [] //相册包含的图片，数组格式
           };
           for(var i = 0; i < row.length; i++){
               var item = {};
               item.alt = "";
               item.pid = row[i]['img_id'];
               item.src = path + "/file/preview/" + row[i]['img_id'];

               //下面是测试代码
               /*if(i == 0){
                   item.src = "http://img2.fengniao.com/product/157_700x2000/785/ceGzpDNTQE.jpg";
               }

               if(i == 1){
                   item.src ="http://img2.fengniao.com/product/157_700x2000/783/cebQPuB1tb0c.jpg";
               }

               if(i == 2){
                    item.src = "http://img2.fengniao.com/product/157_700x2000/787/ce6ESi3znaAKY.jpg";
               }*/

               item.thumb = "";

               img_data.data.push(item);
           }
           //调用示例
           layer.photos({
            photos: img_data
            ,anim: 5 //0-6的选择，指定弹出图片动画类型，默认随机（请注意，3.0之前的版本用shift参数）
            });
       });
    }

   $(document).ready(function() {
        $('#rooms').bootstrapTable({
            url: path+"/products/roomId?roomId="+id,
            method:"GET",
            cache: false,
            showRefresh:true,
            pageNumber:1,
            pageSize:10,
            search:true,
            pagination:true,
            queryParamsType:'',
            sidePagination: "server",
            queryParams: function queryParams(params) {
                return {
                    pageNo: params.pageNumber,
                    pageSize: params.pageSize
                }
            },
            responseHandler:function(res) {
                _grid_data = res.data.records;
                return {
                    "rows": res.data.records,
                    "total": res.data.total
                }

            },
            columns: [{
                title: '行号',//标题  可不加
                formatter: function (value, row, index) {
                    return index+1;
                }
            },{
                field: 'name',
                title: '拍品名称',
                formatter: function (value, row, index) {
                    return "<a href='javascript:void(0)' onclick='pop_imgs("+index+")' style='color:dodgerblue'>"+value+"</a>";
                }
            }, {
                field: 'introduction',
                title: '简介'
            },{
                field: 'detail',
                title: '详情'
            },{
                field: 'start_price',
                title: '起拍价',
                formatter: function (value, row, index) {
                    /**
                     * 实现价格保留两位小数，如果没有小数的后面的值得自动补00
                     */
                    return value.toFixed(2);
                }
            },{
                field: 'status',
                title: '状态',
                formatter: function (value, row, index) {
                    switch (value){
                        case STATUS.UNPAID:
                            return "未支付";
                        case STATUS.UNDELIVERED:
                            return "待发货";
                        case STATUS.UNRECEIVED:
                            return "未接收";
                        case STATUS.RECEIVED:
                            return "已接收";
                        case STATUS.COMPLETE:
                            return "已完成";
                        default:return "-";
                    }
                }
            }]
        });





       $(window).bind("resize",
            function() {
                var width = $(".jqGrid_wrapper").width();
                // $("#table_list_1").setGridWidth(width);

            })
    });
</script>
<script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script>
</body>


<!-- Mirrored from www.zi-han.net/theme/hplus/table_jqgrid.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 20 Jan 2016 14:20:02 GMT -->
</html>
